FontInfo

data class FontInfo(val family: String, val legacyFamily: String, val subFamily: String, val postScriptName: String, val weight: Int, val fontWeight: FontWeight, val style: FontStyle, val isVariable: Boolean, val variationAxes: List<VariationAxis>, val openTypeFeatures: List<String>)

The identity of a font file: its names, weight, style, variation axes and OpenType features. A variable font is described by its default instance.

Constructors

Link copied to clipboard
constructor(family: String, legacyFamily: String, subFamily: String, postScriptName: String, weight: Int, fontWeight: FontWeight, style: FontStyle, isVariable: Boolean, variationAxes: List<VariationAxis>, openTypeFeatures: List<String>)

Properties

Link copied to clipboard

The typographic family name (OpenType name ID 16), or the legacy family name when the font has none.

Link copied to clipboard

The named weight that is closest to weight.

Link copied to clipboard

Whether the font has an fvar table.

Link copied to clipboard

The legacy family name (name ID 1). It can name the weight too, such as "Inter Semi Bold".

Link copied to clipboard

The OpenType feature tags of the font's GSUB and GPOS tables, such as tnum or ss01, sorted and without duplicates. BlockApi.setTextOpenTypeFeatures takes these tags.

Link copied to clipboard

The PostScript name (name ID 6).

Link copied to clipboard

FontStyle.ITALIC when the font is marked italic or oblique.

Link copied to clipboard

The typographic subfamily name (name ID 17), or the legacy subfamily name (ID 2) when the font has none.

Link copied to clipboard

The variation axes of a variable font, in the order of its fvar table. Empty for a static font.

Link copied to clipboard
val weight: Int

The weight class from the OS/2 table, from 1 to 1000. Without one, 700 when the head table marks the font bold, otherwise 400.